package com.bd.scm.module.globalParams.service.impl;

import com.bd.scm.dao.mapper.globalParams.BdSysGlobalParamsMapper;
import com.bd.scm.domain.models.globalParams.BdSysGlobalParams;
import com.bd.scm.module.common.BaseServiceImpl;
import com.bd.scm.module.globalParams.BdSysGlobalParamsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 考勤参数设置.
 * </p>
 *
 * @author Mason
 * @since 2020-08-12
 */
@Service
public class BdSysGlobalParamsServiceImpl extends BaseServiceImpl<BdSysGlobalParamsMapper, BdSysGlobalParams> implements BdSysGlobalParamsService {

    @Resource
    private BdSysGlobalParamsMapper bdSysGlobalParamsMapper;

    /**
     * 获取考勤配置的参数.
     *
     * @return
     */
    @Override
    public List<BdSysGlobalParams> getConfigData() {
        return this.list();
    }

    /**
     * 保存考勤配置的参数.
     *
     * @param bdSysGlobalParams
     * @return
     */
    @Override
    public void saveKqConfig(BdSysGlobalParams bdSysGlobalParams) {
        //this.save(bdSysGlobalParams);
        if(null==bdSysGlobalParams.getId()){
            bdSysGlobalParamsMapper.saveKqConfig(bdSysGlobalParams);
        }else{
            bdSysGlobalParamsMapper.updateKqConfig(bdSysGlobalParams);
        }
    }
}
